package TP1;

import java.util.Date;
import java.util.HashMap;
import java.util.Vector;
import java.util.Map.Entry;

public class Application
{

	/**
	 * @param args
	 */
	/*public static void main(String[] args)
	{
		String repertoire = "./data";
		Dictionnaire dico = new Dictionnaire(repertoire);
		dico.calculIdf();
		HashMap<String, Double>  tfidf = dico.tfIdfDocument("1/3-1msg1.txt") ;
		for (Entry<String, Double> mot : tfidf.entrySet())
		{
			System.out.println(" Mot : " + mot.getKey() + "\ttfidf : " + mot.getValue());
		}
		
		
		
		
		
		
		// TODO Auto-generated method stub
		Vector<String> listDirIndex = new Vector<String>();
		StatsIndex stats = new StatsIndex();
		for(int i = 1; i < 11; ++i)
		{
			listDirIndex.add("corpus/" + i);
		}
		double timeStart = new Date().getTime();
		double timeTmp = new Date().getTime();
		for(int j = 0; j < 10; j++)
		{
			Vector<String> listDirToAdd = new Vector<String>();
			Vector<String> listDirToEvalue = new Vector<String>();
			for(int i = 0; i < 10; ++i)
			{
				if(i != j)
					listDirToAdd.add(listDirIndex.get(i));
				else
					listDirToEvalue.add(listDirIndex.get(i));
			}
			System.out.println(" test " + (j+1));
			Indexeur indexeur = new Indexeur(new IndexBernoulli());
			indexeur.parcourDir(listDirToAdd);
			indexeur.parcourDirEvalue(listDirToEvalue, stats);
			System.out.println("temps calcul : " + (new Date().getTime() - timeTmp));
			timeTmp = new Date().getTime();
		}
		stats.AfficheMoyenne();
		System.out.println("temps calcul total: " + (new Date().getTime() - timeStart));
	
	}*/

}
